﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true"
    CodeBehind="Subscriber.aspx.cs" Inherits="Billing2.Subscriber" %>

<%@ Register Src="~/Controls/ucPageTitle.ascx" TagName="ucPageTitle" TagPrefix="uc2" %>
<%@ Register Src="~/Controls/ucInProgress.ascx" TagName="ucInProgress" TagPrefix="uc3" %>
<%@ Register Src="~/Controls/ucSearch.ascx" TagName="ucSearch" TagPrefix="uc4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <uc2:ucPageTitle ID="ucPageTitle1" runat="server" />
    <asp:UpdatePanel ID="UpdatePanel5" runat="server">
        <ContentTemplate>
            <uc4:ucSearch ID="ucSearch" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <br />
    <div >
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate><div class="gridDetail">
            <asp:GridView ID="gvView" runat="server" CellPadding="4" CssClass="GridViewStyle"
                GridLines="Horizontal" AutoGenerateColumns="False" OnRowCommand="gvwCostCenter_RowCommand"
                AllowPaging="True" AllowSorting="True" EnableSortingAndPagingCallbacks="True"
                OnPageIndexChanging="gvView_PageIndexChanging" OnSorting="gvView_Sorting" PageSize="50" PagerSettings-Mode="NumericFirstLast" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" ForeColor="Black">
                <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                <RowStyle CssClass="GridViewRowStyle" />
                <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                <HeaderStyle CssClass="GridViewHeaderStyle" BackColor="#333333" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="No">
                        <ItemTemplate>
                            <asp:Label ID="xCol01" runat="server" Text='<%#Container.DataItemIndex+1  %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Organization ID"
                        SortExpression="OrgIDName">
                        <ItemTemplate>
                            <asp:Label ID="xCol02" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("OrgIDName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Site ID" SortExpression="SiteIDName">
                        <ItemTemplate>
                            <asp:Label ID="xCol03" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("SiteIDName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Cost Centre ID"
                        SortExpression="CostCentreIDName">
                        <ItemTemplate>
                            <asp:Label ID="xCol04" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("CostCentreIDName")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Email" SortExpression="Email">
                        <ItemTemplate>
                            <asp:Label ID="xCol012" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("Email")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Username" SortExpression="Username">
                        <ItemTemplate>
                            <asp:Label ID="xCol06" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("Username")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="ServiceType" SortExpression="ServiceType">
                        <ItemTemplate>
                            <asp:Label ID="xCol06" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ServiceType")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Host Name" SortExpression="AssetID">
                        <ItemTemplate>
                            <asp:Label ID="xCol06" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("AssetID")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
<%--                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Hostname" SortExpression="Hostname">
                        <ItemTemplate>
                            <asp:Label ID="xCol06" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("Hostname")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>--%>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Effective Date"
                        SortExpression="EffectiveDate">
                        <ItemTemplate>
                            <asp:Label ID="xCol09" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("EffectiveDate","{0:dd/MM/yyyy}")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Termination Date"
                        SortExpression="TerminatedDate">
                        <ItemTemplate>
                            <asp:Label ID="xCol10" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("TerminatedDate","{0:dd/MM/yyyy}")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Status" SortExpression="RecordStatus">
                        <ItemTemplate>
                            <asp:Label ID="xCol11" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("RecordStatus")))%>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
                <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
            </asp:GridView></div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </div>
    <br />
    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
        <ContentTemplate>
        <%--
        This Print button with PostBackUrl will cause exception: all event in the current page will not function after this button was clicked.
        The exception is Sys.WebForms.PageRequestManagerParserErrorException
        To solve it: move it out from UpdatePanel and use Server.Transfer in onclick event
   
         <asp:Button ID="BtnPrint" runat="server" Text="Print" CssClass="ui-state-default ui-corner-all"
                            PostBackUrl="ReportForm.aspx" 
                OnClientClick="form.target='_blank'" />
        --%>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel4">
        <ProgressTemplate>
            <uc3:ucInProgress ID="ucInProgress1" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="UpdatePanel3">
        <ProgressTemplate>
            <uc3:ucInProgress ID="ucInProgress2" runat="server" />
        </ProgressTemplate>
    </asp:UpdateProgress>
    <br />
    <asp:Button ID="btnPrint" runat="server" Text="Print" CssClass="ui-state-default ui-corner-all" PostBackUrl="SubscriberReportForm.aspx" OnClick="btnPrint_Click" />

</asp:Content>
